<?php

namespace app\admin\model\xilujob;

use think\Cache;
use think\Model;


class Salary extends Model
{

    // 表名
    protected $name = 'xilujob_salary';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'option_type_text'
    ];
    

    
    public function getOptionTypeList()
    {
        return ['1' => __('Option_type 1'), '2' => __('Option_type 2'), '3' => __('Option_type 3')];
    }


    public function getOptionTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['option_type']) ? $data['option_type'] : '');
        $list = $this->getOptionTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }

}
